#include<Ticker.h>
#include <SoftwareSerial.h>
Ticker timer;
SoftwareSerial serial1(12, 14); 
int Pulse_number = 0;
int rotate = 0;
void Rotate_timer(){
  rotate = 35*Pulse_number*60*10/370;
  Pulse_number = 0;
  //Serial.print("当前转速为：");
  //Serial.println(rotate);
  serial1.println(String(rotate));
}


void setup() {
  // put your setup code here, to run once:
  serial1.begin(9600);
  Serial.begin(115200);
  pinMode(10, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(10), InterruptFunc, RISING);
  timer.attach(0.1,Rotate_timer);
}

void loop() {

}

ICACHE_RAM_ATTR void InterruptFunc(){   //中断响应函数
  Pulse_number ++;
}
